package com.kws.system.api;

import com.kws.common.core.constant.ServiceNameConstants;
import com.kws.common.core.domain.R;
import com.kws.system.api.domain.Rq.AlipayRefundOrderRq;
import com.kws.system.api.domain.Rq.AlipayWebRq;
import com.kws.system.api.domain.Rq.CreateWeixinPayOrderRq;
import com.kws.system.api.domain.Rq.WeixinPayRefundRq;
import com.kws.system.api.factory.RemotePaymentFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author : zhangbenting
 * @date : 2024/11/26 13:40
 * @Version: 1.0
 */
@FeignClient(contextId = "remotePaymentService", value = ServiceNameConstants.PAYMENT_SERVICE)
public interface RemotePaymentService {

    @ApiOperation("web端微信支付-下单")
    @PostMapping("/create/weixinWebPay/order")
    public R createWeixinWebPayOrder(@RequestBody CreateWeixinPayOrderRq rq);

    @ApiOperation("H5端微信支付-下单")
    @PostMapping("/create/weixinH5Pay/order")
    public R createWeixinH5PayOrder(@RequestBody CreateWeixinPayOrderRq rq);

    @ApiOperation("web端微信支付-关闭订单")
    @GetMapping("/close/weixinWebPay/order")
    public R closeWeixinWebPayOrder(@RequestParam(value = "orderNo") String orderNo);

    @ApiOperation("H5端微信支付-关闭订单")
    @GetMapping("/close/weixinH5Pay/order")
    public R closeWeixinH5PayOrder(@RequestParam(value = "orderNo") String orderNo);

    @ApiOperation("微信支付退款申请")
    @PostMapping("/refund/weixinPay")
    public R weixinPayRefundOrder(@RequestBody WeixinPayRefundRq rq);

    @ApiOperation("支付宝web端下单拉起支付")
    @PostMapping("/create/alipayWeb/order")
    public R alipayWebOrder(@RequestBody AlipayWebRq rq);

    @ApiOperation("取消支付订单")
    @GetMapping("/cancel/alipay/order")
    public R cancelAlipayOrder(@RequestParam String orderNo);

    @ApiOperation("根据订单号进行退单退款")
    @PostMapping("/refund/order")
    public R refundOrder(@RequestBody AlipayRefundOrderRq rq);
}
